package com.bw.zg3park2212.task

import androidx.lifecycle.MutableLiveData
import com.bw.base.entity.PointEntityItem
import com.bw.base.entity.TaskEntity
import com.bw.base.entity.TaskEntityItem
import com.bw.base.mvvm.BaseViewModel
import com.bw.base.net.ApiService
import dagger.hilt.android.lifecycle.HiltViewModel
import javax.inject.Inject

@HiltViewModel
class TaskViewModel @Inject constructor(val  apiService: ApiService): BaseViewModel() {
    val taskSuccse= MutableLiveData<TaskEntity>()
    fun gettask(){
        httpRequst(
            {apiService.gettask()},
            taskSuccse::postValue
        )
    }
    val taskstutseSuccse=MutableLiveData<TaskEntity>()
    fun gettaskstutse(id:String){
        httpRequst(
            {apiService.gettaskstatus(id)},
            taskstutseSuccse::postValue)
    }
    val taskxiangSuccse=MutableLiveData<TaskEntityItem>()
    fun gettaskxiang(id:Int){
        httpRequst(
            {apiService.gettaskxiang(id)},
            taskxiangSuccse::postValue)
    }
    val pointxiangSuccse=MutableLiveData<PointEntityItem>()
    fun getpointxiang(id:Int){
        httpRequst(
            {apiService.getpointxiang(id)},
            pointxiangSuccse::postValue)
    }
}